package com.vnaloha.common.validation;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.vnaloha.common.model.Gallery;

public class GalleryValidator implements Validator {

	@Override
	public boolean supports(Class<?> clazz) {
		
		return Gallery.class.equals(clazz);
	}

	@Override
	public void validate(Object object, Errors e) {
		ValidationUtils.rejectIfEmpty(e, "title", "title.empty");
//		Gallery gallery = (Gallery) object;
	}
}
